<extend name="Layout/ins_page" />
<block name="content">
	{:W('PageHeader/adv_search',array('name'=>$folder_name,'search'=>'M'))}
	<div class="x-panel hidden" id="adv_search">
		<form method="post" name="form_adv_search" id="form_adv_search">
			<div class="x-panel-header">
				<h4>高级搜索</h4>
				<div class="split"></div>
				<a  class="btn" id="submit_adv_search">搜索</a>
				<a  class="btn btn-cancel" id="close_adv_search">关闭</a>
			</div>
			<div class="x-panel-body">
				<div class="frame">
					<div class="bit-2">
						<div class="layui-form-item ">
							<label class=" layui-form-label" for="li_name">文件名：</label>
							<div class="layui-input-block">
								<input class="layui-input" type="text" id="li_name" name="li_name">
							</div>
						</div>
					</div>
					<div class="bit-2">
						<div class="layui-form-item">
							<label class=" layui-form-label" for="li_content">内容：</label>
							<div class="layui-input-block">
								<input class="layui-input" type="text" id="li_content" name="li_content">
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<div class="bit-2">
					<div class="layui-form-item ">
						<label class="layui-form-label" for="eq_user_name">登录人：</label>
						<div class="layui-input-block">
							<input class="layui-input" type="text" id="eq_user_name" name="eq_user_name">
						</div>
					</div>
				</div>
				<div class="bit-2">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">登录时间：</label>
							<div class="layui-input-inline" style="width: 100px;">
								<input type="text" class="layui-input input-start-date" name="be_create_time" readonly="readonly" />
							</div>
							<div class="layui-form-mid">
								-
							</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input type="text" class="layui-input input-end-date" name="en_create_time" readonly="readonly" />
							</div>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
	<div class="oprator-panel">
		<div class="split"></div>
		<if condition="$auth['read']">
			<a class="btn" id="btn_add">发布任务</a>
		</if>
	</div>
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<if condition="$auth['admin']">
				<li class="<eq name="fid" value="all">layui-this</eq>">
					<a class="link" href="{:U('folder','fid=all')}">所有任务</a>
				</li>
			</if>
			<if condition="$auth['write']">
				<li class="hidden <eq name="fid" value="dept">layui-this</eq>">
					<a class="link" href="{:U('folder','fid=dept')}">部门任务</a>
				</li>
			</if>
			<li class="<eq name="fid" value="sub">layui-this</eq>">
				<a class="link" href="{:U('folder','fid=sub')}">下属任务</a>
			</li>
			<li class="<eq name="fid" value="no_finish">layui-this</eq>">
				<a class="link" href="{:U('folder','fid=no_finish')}">我未完成</a>
			</li>
			<li class="hidden <eq name="fid" value="no_assign">layui-this</eq>">
				<a class="link" href="{:U('folder','fid=no_assign')}">待领任务</a>
			</li>
			<li class="<eq name="fid" value="finished">layui-this</eq>">
				<a class="link" href="{:U('folder','fid=finished')}">我已完成</a>
			</li>
			<li class="<eq name="fid" value="my_task">layui-this</eq>">
				<a class="link" href="{:U('folder','fid=my_task')}">我发布的</a>
			</li>
			<li class="<eq name="fid" value="my_assign">layui-this</eq>">
				<a class="link" href="{:U('folder','fid=my_assign')}">我指派的</a>
			</li>
		</ul>
	</div>
	<div class="ul-table ul-table_responsive">
		<ul>
			<li class="thead">
				<span class="col-8 ">编号</span>
				<span class="col-8 ">发起人</span>
				<span class="col-12 autocut grow-1"> 标题 </span>
				<span class="col-20 autocut">指派给</span>
				<span class="col-12">发起时间</span>
				<span class="col-12">期望完成时间</span>
				<span class="col-6 ">状态</span>
				<span class="col-6 text-center">操作</span>
			</li>
			<empty name="list">
				<li class="no-data">
					没找到数据
				</li>
				<else />
				<foreach name="list" item="vo">
					<li class="tbody">
						<span class="col-8 ">{$vo.task_no}</span>
						<span class="col-8 ">{$vo.user_name}</span>
						<span class="col-12 autocut grow-1"> <a href="{:U('read','id='.$vo['id'])}">{$vo.name}</a> </span>
						<span class="col-20 autocut">&nbsp;{$vo.executor|show_contact}</span>
						<span class="col-12">{$vo.create_time|to_date='Y-m-d H:i'}&nbsp;</span>
						<span class="col-12">{$vo.expected_time|substr=0,16}&nbsp;</span>
						<span class="col-6">{$vo.status|task_status}&nbsp;</span>
						<span class="col-6 text-center">
							<if condition="($vo.status lt 30) and ($vo.user_id eq $user_id)">
								<a href="{:U('edit','id='.$vo['id'])}">修改</a>&nbsp;<a href="{:U('del','id='.$vo['id'])}">删除</a>
								<else/>
								<if condition="($auth['admin'])">
									<a href="{:U('edit','id='.$vo['id'])}">修改</a>&nbsp;<a href="{:U('del','id='.$vo['id'])}">删除</a>
								</if>
							</if></span>
					</li>
				</foreach>
			</empty>
		</ul>
		<notempty name="list">
			<div class="pagination">
				{$page}
			</div>
		</notempty>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'element'], function() {
			var $ = layui.jquery;
			set_return_url(null);
			$("#btn_add").on('click', function add() {
				window.open("{:U('add')}", "_self");
			});
		});
	</script>
</block>
